package org.ftc.security;

import java.util.Collection;
import java.util.List;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

public class User implements UserDetails  {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7355969229203049354L;
	private String username;// 
    private String password;// 
    private String role;// 
    public String getRole() {
		return role;
	}

	private String ip;//
    private String browser;
    private boolean isEnabled;
    private Collection<GrantedAuthority> grantedAuthorities;
    
    public User(String username, String password) {
        this.username = username;
        this.password = password;
    }
    
    public User(String username, String password, String role) {
        this.username = username;
        this.password = password;
        this.role = role;
    }
    
    public User(String username, String password, boolean isEnabled, String role, List<GrantedAuthority> authSet) {
        this.username = username;
        this.password = password;
        this.role = role;
        this.isEnabled = isEnabled;
        this.grantedAuthorities = authSet;
    } 
    
    public Collection<GrantedAuthority> getAuthorities() {
		return this.grantedAuthorities; 
	}

	public String getPassword() {
		return this.password;
	}

	public String getUsername() {
		return this.username;
	} 

	public boolean isAccountNonExpired() {
		return true;
	}

	public boolean isAccountNonLocked() {
		return true;
	}

	public boolean isCredentialsNonExpired() {
		return true;
	}

	public boolean isEnabled() {
		return this.isEnabled;
	}
	
	public String getIp() {
		return ip;
	}

	public String getBrowser() {
		return browser;
	}

	
}
